<?php
/**
 * @Author: 976123967@qq.com
 * @Date:   2014-09-06 20:11:01
 * @Last Modified by:   chen
 * @Last Modified time: 2014-09-06 20:11:05
 */

/**
 * 获得随机字符串
 * @param int $len 长度
 * @return string
 */
function rand_str($len = 6) 
{
    $data = 'abcdefghijklmnopqrstuvwxyz0123456789';
    $str = '';
    while (strlen($str) < $len)
        $str .= substr($data, mt_rand(0, strlen($data) - 1), 1);
    return $str;
}
